﻿<UserControl x:Class="ForumsBrowser.ForumView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:fb="clr-namespace:ForumsBrowser"
    x:Name="forumViewControl"
    >
    <UserControl.Resources>
        <ResourceDictionary>
            <fb:ThreadList x:Key="threads"/>
            <DataTemplate x:Key="DetailedItem">
                <fb:ThreadListItem ClipToBounds="False" HorizontalAlignment="Stretch" Browse="ThreadListItem_Browse" ViewLastPost="ThreadListItem_ViewLastPost" ViewPost="ThreadListItem_ViewPost" />
            </DataTemplate>
            <DataTemplate x:Key="SummaryItem">
                <fb:ThreadListSummaryItem ClipToBounds="False"  HorizontalAlignment="Stretch" Browse="ThreadListItem_Browse" ViewLastPost="ThreadListItem_ViewLastPost" ViewPost="ThreadListItem_ViewPost" />
            </DataTemplate> 
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="DefaultStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </UserControl.Resources>

    <ListView x:Name="listView1" ItemsSource="{Binding Source={StaticResource threads}}" 
              Foreground="White" Background="{Binding ElementName=forumViewControl, Path=Background}"
              BorderThickness="0" BorderBrush="Blue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
              HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
              Width="{Binding ElementName=forumViewControl, Path=ActualWidth}" >
    </ListView>
</UserControl>
